<template>
	<view class="newAll" @click="fn2">
		<view class="newTop">
			<view class="TopLeft">
				<dir class="left">
					<image class="suang" src="../../static/images/pl5.png" mode=""></image>
					<div>
						<h4 class="pall">双色球</h4>
						<text class="title">220202</text>
					</div>
				</dir>
				<div class="right"  >
					<img class="time" src="../../static/images/ls.png" alt="">
					<text   >全部开奖</text>
				</div>
			</view>
		</view>
		<!-- //球 -->

		<div class="sevenbox">
			<view :class="activeIndex==index ? 'active': 'seven'" @click="change(index)" v-for="(item,index) in lottery_res " :key="index">{{item}} </view>
		</div>

		<view class="price">
			<view class="prices">
				<div>本期数量（元）</div>
				<div>{{list.lottery_pool_amount}}</div>
				
			</view>
			<view class="prices">
				 <div>奖池信息（元）</div>
				 <div>{{list.lottery_sale_amount}}</div>
			</view>
		</view>
		<!-- //表格 -->
		<uni-table border stripe emptyText="暂无更多数据">
			<!-- 表头行 -->
			<uni-tr>
				<uni-th align="center">奖项</uni-th>
				<uni-th align="center">获奖条件</uni-th>
				<uni-th align="left">中奖注数</uni-th>
				<uni-th align="left">每注奖金（元）</uni-th>
			</uni-tr>
			<!-- 表格数据行 -->
			<uni-tr v-for="(item,index) in  list.lottery_prize" :key="index" >
				<uni-td>{{item.prize_name}}</uni-td>
				<uni-td>{{item.prize_require}}</uni-td>
				<uni-td>{{item.prize_num}}</uni-td>
				<uni-td>{{item.prize_amount}}</uni-td>
			</uni-tr>
		 

		</uni-table>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				list: [],
				lottery_res: {},
				activeIndex:0,
				goAll:{},
				id:''

			}
		},
		onLoad(id) {
			console.log(id.id);
			this.id=id.id
			uni.request({
				url: "http://api.aslegou.top/api/cpdesc",
				data: {
					lottery_id: id.id
				},

				success: (res) => {
					// console.log(res);
					this.list = res.data.list
					this.goAll=res.data.list
					console.log(this.goAll);
					this.lottery_res = res.data.list.lottery_res.split(',')
					 // console.log(res.data.list.lottery_res);
				}
			})
		},
        methods:{
			fn2(){
				uni.navigateTo({
					url:"/pages/desc/desc?id="+this.id
				})
			},
			change(index){
				this.activeIndex=index
			}
		
		}
	}  
</script>

<style>
	.newAll {
		height: 100%;
		width: 100%;
		/* background-color: #ff5f7f; */
	}

	.TopLeft {
		height: 70px;
		background-color: #fff;
		color: #000;
		padding: 0 10px;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.suang {
		width: 50px;
		height: 50px;
		border-radius: 50%;
		margin-right: 5px;
	}

	.time {
		width: 20px;
		height: 20px;
		border-radius: 50%;
	}

	.left {
		display: flex;
	}

	.right {
		color: #ff5f7f;
		font-size: 13px;
	}

	.pall {
		font-weight: 900;
		font-size: 20px
	}

	.title {
		color: #ccc;
		font-size: 14px
	}

	.sevenbox {
		display: flex;
		padding: 0 10px;
		/* margin-right: 7px; */
	}

	.seven {
		width: 30px;
		height: 30px;
		margin-right: 7px;
		border-radius: 50%;
		border: 1px solid #fd6483;
		text-align: center;
		line-height: 30px;
	}

	.price {
		display: flex;
		width: 100%;
		height: 50px;
		align-items: center;
		text-align: center;
		margin: 20px 0; 
		color: #ccc;
	}

	.prices {
		width: 50%;
		height: 50px;
		text-align: center;
		/* background-color: #d00; */
	}
	active{
		width: 30rpx;
		height: 30rpx;
		margin-right: 7rpx;;
		border-radius: 50%;
		border: 1rpx solid #fd6483;
		text-align: center;
		line-height: 30rpx;
	}
</style>
